
PilotUtility.prototype.runningStddev = function() {
    var _n = 0;
    var _sum = 0.0;
    var _sum_sq = 0.0;
    var _stddev = 0.0;
    var _mean = 0.0;
    function mean() {
      return _mean;
    }
    function stddev() {
      return _stddev;
    }
    return function(num) {
        _n++;
        _sum += num;      
        _mean = _sum/_n;  
        _sum_sq += num*num;
        _stddev = Math.sqrt( (_sum_sq / _n) - Math.pow(_sum / _n, 2) );
        return _stddev;
    }  
}
